package android.gpsmessenger;

public class Contact 
{
	private String _name;
	private String _phone;
	private String _email;
	private String _id;
	
	// constructors
	Contact(String name, String phone, String email, String id)
	{
		_name = name;
		_phone = phone;
		_email = email;
		_id = id;
	}	
	
	Contact(String name, String phone)
	{
		this(name, phone, "", "friend");
	}
	
	Contact(String name)
	{
		this(name, "", "", "friend");
	}
	
	Contact()
	{
		this("", "", "", "friend");
	}
	
	// copy constructor
	Contact(Contact contact)
	{
		this(contact.getName(), contact.getPhone(), contact.getEmail(), contact.getID());
	}	

	// getters
	public String getName()
	{
		return _name;
	}
	
	public String getPhone()
	{
		return _phone;
	}	
	
	public String getEmail()
	{
		return _email;
	}	
	
	public String getID()
	{
		return _id;
	}	
	
	// setters
	public void setName(String name)
	{
		_name = name;
	}
	
	public void setPhone(String phone)
	{
		_phone = phone;
	}
		
	public void setEmail(String email)
	{
		_email = email;
	}
	
	public void setID(String id)
	{
		_id = id;
	}
	
	// other methods
	public String toString()
	{
		return _name + " <" + _id + "> " + " <" + _phone + "> " + _email;
	}
		
	public boolean equals(Contact contact)
	{
	    if (_name.equals(contact.getName()) &&
	    		_phone.equals(contact.getPhone()) &&
	    		_email.equals(contact.getEmail()) &&
	    		_id.equals(contact.getID()))
	        return true;
	    else
	        return false;
	}
	
}
